package com.rocky.study.generic;

public class GenericMethodDemo2 {

    public static <T extends Comparable> T max(T[] arr) {
        T max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].compareTo(max) > 0) {
                max = arr[i];
            }
        }
        return max;
    }
}
